<%--
  Created by IntelliJ IDEA.
  User: limin
  Date: 2021/8/8
  Time: 19:50
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE HTML>
<html>
<head>
    <base href="<%=basePath%>">

    <title></title>

    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">

    <link rel="stylesheet" type="text/css" href="css/maintable.css" >
    <link rel="stylesheet" type="text/css" href="css/edittable.css"  >
    <link rel="stylesheet" type="text/css" href="css/validate.css"  >
    <script type="text/javascript"  src="js/jquery-1.8.0.js"></script>
    <style type="text/css">
    .catenametd{
        width:140px;
    }
    .secondtd{
        width:23%;
    }

</style>
</head>

<body>
<div class ="div_title">
    <div class="div_titlename"> <img src="images/san_jiao.gif" ><span>商品维护 分类管理</span></div>
</div>
<table class="main_table">
    <tr>
        <th colspan="2">一级分类</th>
        <th colspan="2">二级分类</th>
    </tr>
    <c:forEach var="catepar" items="${cateInfoList}">
            <c:if test="${catepar.parentId == 0}">
                <tr>
                    <td class="catenametd">${catepar.cateName}</td>
                    <td>
                        <a href="goods/bigcate_edit.jsp?id=${catepar.id}">修改</a> |
                        <a href="CateServlet.do?flag=deleteCate&id=${catepar.id}" onclick="return confirm('确定删除此分类吗')">删除</a>
                    </td>
                    <td class="catenametd">
                    <c:forEach var="cateson" items="${cateInfoList}">
                            <c:if test="${catepar.id == cateson.parentId}">
                                ${cateson.cateName} <br>
                            </c:if>
                    </c:forEach>
                    </td>
                    <td>
                        <c:forEach var="cateson" items="${cateInfoList}">
                            <c:if test="${catepar.id == cateson.parentId}">
                                <a href="goods/smallcate_edit.jsp?id=${cateson.id}">修改</a> |
                                <a href="CateServlet.do?flag=deleteCate&id=${cateson.id}" onclick="return confirm('确定删除此分类吗')">删除</a><br>
                            </c:if>
                        </c:forEach>
                    </td>

                </tr>
            </c:if>

    </c:forEach>
</table>
</body>
${msg}
</html>
